import request from "@/utils/request";

export function getGradeList(params:any) {
    return request({
        url: '/api/grade',
        method: 'get',
        params
    });
}


export function getGradeDetail(id:string) {
    return request({
        url: `/api/grade/${id}`,
        method: 'get'
    });
}


export function updateGrade(data:any) {
    return request({
        url: `/api/grade/${data.id}`,
        method: 'put',
        data
    });
}


export function deleteGrade(id:string) {
    return request({
        url: `/api/grade/${id}`,
        method: 'delete'
    });
}


export function batchDeleteGrade(ids:string[]) {
    return request({
        url: '/api/grade/batch',
        method: 'post',
        data: ids
    });
}


export function createGrade(data:any){
    return request({
        url:'/api/grade',
        method: "post",
        data
    });
}

export function getStudentList() {
    return request({
        url: '/api/grade/student',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}

export function getTeacherList() {
    return request({
        url: '/api/grade/teacher',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}

